3.1.3 \(\int (a+a \sin (c+d x)) \tan (c+d x) \, dx\) [3]

Optimal. Leaf size=30 \[ -\frac {a \log (1-\sin (c+d x))}{d}-\frac {a \sin (c+d x)}{d} \]

[Out]

-a*ln(1-sin(d*x+c))/d-a*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2786, 45} \begin {gather*} -\frac {a \sin (c+d x)}{d}-\frac {a \log (1-\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[c + d*x])*Tan[c + d*x],x]

[Out]

-((a*Log[1 - Sin[c + d*x]])/d) - (a*Sin[c + d*x])/d

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int (a+a \sin (c+d x)) \tan (c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {x}{a-x} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (-1+\frac {a}{a-x}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=-\frac {a \log (1-\sin (c+d x))}{d}-\frac {a \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 38, normalized size = 1.27 \begin {gather*} \frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \log (\cos (c+d x))}{d}-\frac {a \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[c + d*x])*Tan[c + d*x],x]

[Out]

(a*ArcTanh[Sin[c + d*x]])/d - (a*Log[Cos[c + d*x]])/d - (a*Sin[c + d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 23, normalized size = 0.77

method result size
derivativedivides \(-\frac {a \left (\sin \left (d x +c \right )+\ln \left (\sin \left (d x +c \right )-1\right )\right )}{d}\) \(23\)
default \(-\frac {a \left (\sin \left (d x +c \right )+\ln \left (\sin \left (d x +c \right )-1\right )\right )}{d}\) \(23\)
risch \(i a x +\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {i a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i a c}{d}-\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(66\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(d*x+c))*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

-1/d*a*(sin(d*x+c)+ln(sin(d*x+c)-1))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 25, normalized size = 0.83 \begin {gather*} -\frac {a \log \left (\sin \left (d x + c\right ) - 1\right ) + a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c),x, algorithm="maxima")

[Out]

-(a*log(sin(d*x + c) - 1) + a*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 27, normalized size = 0.90 \begin {gather*} -\frac {a \log \left (-\sin \left (d x + c\right ) + 1\right ) + a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c),x, algorithm="fricas")

[Out]

-(a*log(-sin(d*x + c) + 1) + a*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \sin {\left (c + d x \right )} \tan {\left (c + d x \right )}\, dx + \int \tan {\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c),x)

[Out]

a*(Integral(sin(c + d*x)*tan(c + d*x), x) + Integral(tan(c + d*x), x))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1456 vs. \(2 (30) = 60\).
time = 7.55, size = 1456, normalized size = 48.53 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))*tan(d*x+c),x, algorithm="giac")

[Out]

-1/2*(a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan
(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^
2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2*tan(1/2*c)^2 - a*log(
2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4
+ 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*
c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2*tan(1/2*c)^2 + a*log(4*(tan(d*x)^
4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*t
an(1/2*d*x)^2*tan(1/2*c)^2 + a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*
x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2
*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^
2 - a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1
/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2
+ tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2 + a*log(4*(tan(d*x)^4*t
an(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(
1/2*d*x)^2 - 4*a*tan(1/2*d*x)^2*tan(1/2*c) + a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c
) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(
1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1
))*tan(1/2*c)^2 - a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/
2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*t
an(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*c)^2 + a*log(4*(
tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^
2 + 1))*tan(1/2*c)^2 - 4*a*tan(1/2*d*x)*tan(1/2*c)^2 + a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4
*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^
3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/
2*c)^2 + 1)) - a*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c
)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(
1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1)) + a*log(4*(tan(d*x)^4*tan(c
)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) + 4*a*ta
n(1/2*d*x) + 4*a*tan(1/2*c))/(d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(1/2*d*x)^2 + d*tan(1/2*c)^2 + d)

________________________________________________________________________________________

Mupad [B]
time = 6.62, size = 43, normalized size = 1.43 \begin {gather*} -\frac {a\,\left (\sin \left (c+d\,x\right )+2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )-\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(a + a*sin(c + d*x)),x)

[Out]

-(a*(sin(c + d*x) + 2*log(tan(c/2 + (d*x)/2) - 1) - log(tan(c/2 + (d*x)/2)^2 + 1)))/d

________________________________________________________________________________________